<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-CN" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link rel="stylesheet" href="/css/yaodian100_v1.css" type="text/css" media="screen" />
<link rel="stylesheet" type="text/css" href="/css/jquery-ui-1.7.2.custom.css">
<script type="text/javascript" charset="UTF-8" src="<c-rt:url value="/js/jquery-1.3.2.min.js"/>"></script>
<script type="text/javascript" charset="UTF-8" src="<c-rt:url value="/js/jquery-ui-1.7.2.custom.min.js"/>"></script>

<script type="text/javascript" charset="UTF-8" src="<c-rt:url value="/js/cart.js"/>"></script>
<script>
var data=
{
		 itemNo: "00000004",
		 specNo: "21",
		 qty: "1",
		 categoryPath: "10/66",
		 type: "0",
		 webpath: "<%=ServerValue.getFrontContextPath()%>/shopping/cart.do?",
		 presents: [{itemNo:"00000007",specNo:"4",qty:"2",categoryPath:"1/14/81",type:"2"}, {itemNo:"00000006",specNo:"22",qty:"2",categoryPath:"1/14/81",type:"2"}],
		 addOns: [{itemNo:"00000011",specNo:"9",qty:"1",categoryPath:"9/63",type:"3"}, {itemNo:"00000012",specNo:"10",qty:"1",categoryPath:"1/15/89",type:"3"}]
};

var data1=
{
		 itemNo: "00000004",
		 specNo: "1",
		 qty: "3",
		 categoryPath: "10/66",
		 type: "0",
		 webpath: "<%=ServerValue.getFrontContextPath()%>/shopping/cart.do?",
		 presents: null,
		 addOns:null
};
var data2=
{
		 itemNo: "00000004",
		 specNo: "21",
		 qty: "1",
		 categoryPath: "10/66",
		 type: "0",
		 webpath: "<%=ServerValue.getFrontContextPath()%>/shopping/cart.do?",
		 presents: null,
		 addOns:null
};
var data3=
{
		 itemNo: "00000007",
		 specNo: "4",
		 qty: "5",
		 categoryPath: "35/39",
		 type: "0",
		 webpath: "<%=ServerValue.getFrontContextPath()%>/shopping/cart.do?",
		 presents: null,
		 addOns:null
};
var data4=
{
		 itemNo: "00000007",
		 specNo: "22",
		 qty: "1",
		 categoryPath: "35/39",
		 type: "0",
		 webpath: "<%=ServerValue.getFrontContextPath()%>/shopping/cart.do?",
		 presents: null,
		 addOns:null
};
var data5=
{
		 itemNo: "00000581",
		 specNo: "182",
		 qty: "1",
		 categoryPath: "1/12/70/425",
		 type: "1",
		 webpath: "<%=ServerValue.getFrontContextPath()%>/shopping/orderBuyNow.do?",
		 presents: [{itemNo:"00000007",specNo:"4",qty:"2",categoryPath:"1/14/81",type:"2"}, {itemNo:"00000006",specNo:"3",qty:"2",categoryPath:"1/14/81",type:"2"}],
		 addOns: [{itemNo:"00000011",specNo:"9",qty:"1",categoryPath:"9/63",type:"3"}, {itemNo:"00000012",specNo:"10",qty:"1",categoryPath:"1/15/89",type:"3"}]
};
var data6=
{
		 itemNo: "00000581",
		 specNo: "182",
		 qty: "1",
		 categoryPath: "1/12/70/425",
		 type: "1",
		 webpath: "<%=ServerValue.getFrontContextPath()%>/shopping/orderBuyNow.do?",
		 presents: null,
		 addOns:null
};
var data7=
{
		 itemNo: "00000004",
		 specNo: "21",
		 qty: "1",
		 categoryPath: "10/66",
		 type: "0",
		 webpath: "<%=ServerValue.getFrontContextPath()%>/shopping/cart.do?",
		 presents: null,
		 addOns: [{itemNo:"00000011",specNo:"9",qty:"1",categoryPath:"9/63",type:"3"}, {itemNo:"00000012",specNo:"10",qty:"1",categoryPath:"1/15/89",type:"3"}]
};
var data8=
{
		itemNo: "00000004",
		 specNo: "21",
		 qty: "1",
		 categoryPath: "10/66",
		 type: "0",
		 webpath: "<%=ServerValue.getFrontContextPath()%>/shopping/cart.do?",
		 presents: [{itemNo:"00000007",specNo:"4",qty:"2",categoryPath:"1/14/81",type:"2"}, {itemNo:"00000006",specNo:"3",qty:"2",categoryPath:"1/14/81",type:"2"}],
		 addOns: null
};
var data9=
{
		itemNo: "00000004",
		 specNo: "21",
		 qty: "1",
		 categoryPath: "10/66",
		 type: "0",
		 webpath: "<%=ServerValue.getFrontContextPath()%>/shopping/cart.do?",
		 presents: [{itemNo:"00000007",specNo:"4",qty:"2",categoryPath:"1/14/81",type:"2"}, {itemNo:"00000006",specNo:"3",qty:"2",categoryPath:"1/14/81",type:"2"}],
		 addOns: [{itemNo:"00000011",specNo:"9",qty:"1",categoryPath:"9/63",type:"3"}, {itemNo:"00000012",specNo:"10",qty:"1",categoryPath:"1/15/89",type:"3"}]
};
var data10=
{
		itemNo: "00000561",
		 specNo: "261",
		 qty: "1",
		 categoryPath: "3/23/163",
		 type: "6",
		 webpath: "<%=ServerValue.getFrontContextPath()%>/shopping/cart.do?",
		 presents: null,
		 addOns: [{itemNo:"00000444",specNo:"141",qty:"1",categoryPath:"1/15/87",type:"6"}, {itemNo:"00000005",specNo:"2",qty:"1",categoryPath:"1/12/71/427",type:"6"}, {itemNo:"00000010",specNo:"8",qty:"1",categoryPath:"3/23/161",type:"6"}]
};
//alert(jsonToString(data['presents'])[0]['itemNo']);

</script>

<script language="javascript">
$().ready( function() {	
	$("#goBuyNow").click(function(){
		$.getJSON("<%=ServerValue.getFrontContextPath()%>/checkLogin.do",{pathparam:'<%=ServerValue.getFrontHostname()%>'+window.location.pathname}
			,function(result){
				if(result=='login'){
					addCart(data5);					
				}else{
					window.location.replace("<%=ServerValue.getFrontContextPath()%>/tologin.do?redirect_url="+result); 
				}
			});			
	});	
});
</script>
</head>
<body>
<br/>
一般商品
<br/>

RICOH Caplio GX200(公司货)4-藍,3個
<a href="javascript:addCart(data1)">
<img border="0" src="http://www.vivi-soap.net/images/cart9.jpg"/>
</a>
<br/>

RICOH Caplio GX200(公司货)4-白,1個
<a href="javascript:addCart(data2)">
<img border="0" src="http://www.vivi-soap.net/images/cart9.jpg"/>
</a>
<br/>

RICOH Caplio GX200(公司货)7,大地色,5個
<a href="javascript:addCart(data3)">
<img border="0" src="http://www.vivi-soap.net/images/cart9.jpg"/>
</a>
<br/>

RICOH Caplio GX200(公司货)7,天空色,1個
<a href="javascript:addCart(data4)">
<img border="0" src="http://www.vivi-soap.net/images/cart9.jpg"/>
</a>

<HR/>
<br/>
预购商品(直接购买)1個
<a href="javascript:addCart(data6)">
<img id="goBuyNow" border="0" src="http://www.vivi-soap.net/images/cart9.jpg"/>
</a>
<br/>

<br/>
预购商品(直接购买),2個贈品，2個加購
<a href="javascript:addCart(data5)">
<img id="goBuyNow" border="0" src="http://www.vivi-soap.net/images/cart9.jpg"/>
</a>
<br/>

<HR/>
<br/>
主商品1個，赠品2個
<a href="javascript:addCart(data8)">
<img id="goBuyNow" border="0" src="http://www.vivi-soap.net/images/cart9.jpg"/>
</a>
<br/>

<HR/>
<br/>
主商品1個，加購2個
<a href="javascript:addCart(data7)">
<img id="goBuyNow" border="0" src="http://www.vivi-soap.net/images/cart9.jpg"/>
</a>
<br/>

<HR/>
<br/>
主商品1個，赠品2個，加購2個
<a href="javascript:addCart(data9)">
<img id="goBuyNow" border="0" src="http://www.vivi-soap.net/images/cart9.jpg"/>
</a>
<br/>

<HR/>
<br/>
N选M(20選3)
<a href="javascript:addCart(data10)">
<img id="goBuyNow" border="0" src="http://www.vivi-soap.net/images/cart9.jpg"/>
</a>

<br/>
</body>
</html>